"""
服务端
"""
from socket import *

s = socket()
s.bind(('127.0.0.1', 8000))
s.listen()

while True:
    conn, addr = s.accept()
    while True:
        msg = conn.recv(1024).decode('utf8')
        if not msg: break
        conn.send(msg.upper().encode('utf8'))
    conn.close()
s.close()
